<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增菜单')" />
</head>
<body class="white-bg">
<form class="form-horizontal m" id="form-user-add">


    <div class="form-group">
        <label class="col-sm-3 control-label is-required">邮箱：</label>
        <div class="col-sm-8">
            <input class="form-control" type="text" name="email" id="email"   required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label is-required">密码(默认1234)：</label>
        <div class="col-sm-8">
            <input class="form-control" type="text"  readonly value="$2a$10$JPahmxCeHOkH8r6.mrGCVeFxFnufMfcz32d1/jsBndusSZB8X2lrK" name="password" id="password"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">昵称：</label>
        <div class="col-sm-8">
            <input class="form-control" type="text" id="nickname"  name="nickname">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 font-noraml">性别</label>
        <select class="col-sm-8 form-control" >
            <option value="0">男</option>
            <option value="1">女</option>
        </select>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label">头像地址：</label>
        <div class="col-sm-8">
            <input class="form-control" type="text" id="avatar_url"   name="avatar_url">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">openid：</label>
        <div class="col-sm-8">
            <input class="form-control" type="text" id="openid" name="openid">
        </div>
    </div>
</form>


<th:block th:include="include :: footer" />
<script type="text/javascript">
		var prefix = ctx + "book/user";

		$("#form-user-add").validate({
			rules:{
				dictSort:{
					digits:true
				},
			},
			focusCleanup: true
		});

		function submitHandler() {
		console.log("submit..");
	        if ($.validate.form()) {
	        console.log($('#form-user-add').serialize());
	        	$.operate.save(prefix + "/add", $('#form-user-add').serialize());
	        }
	        else
	        {
	            console.log("validate fail");
	        }
	    }


	</script>

</body>
</html>